import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-03-27
 * Time: 20:27
 */
class PersonA{
    public String ID;
    public PersonA(String ID){
        this.ID = ID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(ID, person.ID);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ID);
    }

    @Override
    public String toString() {
        return "Person{" +
                "ID='" + ID + '\'' +
                '}';
    }
}

public class Test {
    public static void main(String[] args) {
        PersonA person1 = new PersonA("123");
        PersonA person2 = new PersonA("123");
        System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());
    }
}
